import { ins } from './request'
/**
 * 获取博客列表数据
 */
export async function getBlogs(page = 1, limt = 10, categoryid = -1) {
    return await ins.get("/api/blog", { page, limt, categoryid });
}

/**
 * 获取博客分类
 */
export async function getblogTypes() {
    return await ins.get("/api/blogtype");
}

/**
 * 获取博客内容
 * @param {*} id 
 */
export async function getBlog(id) {
    return await ins.get(`/api/blog/${id}`);
}

/**
 * 提交评论
 * @param {*} info
 */
export async function postComment(info) {
    return await ins.post(`/api/comment`, info);
}

/**
 * 分页获取评论
 */
export async function getComment(blogid, page = 1, limit = 10) {
    return await ins.get(`/api/comment`, {
        params: { blogid, page, limit }
    });
}
